<?php
/**
 * 注册用户
 */
header('Content-Type:text/html;charset=utf8');
?>
<?php include './../layout/head.inc.php' ?>
<div id="accountVM" class="d-flex full-height full-width align-items-center justify-content-center">
    <div class="bg-primary">
        <form ref="accountRef" class="box-border-gradient p-20" style="width:400px;height:300px;">
            <h1 class="text-gold">{{form.action==='reg'?'注册':'登录'}} <a href="javascript:;" class="text-green font-size-14" @click="form.action=(form.action==='reg'?'login':'reg')">{{form.action==='login'?'注册':'登录'}}</a>
            </h1>
            <div class="mb-10 d-flex align-items-center">
                <label style="width:80px;" for="username" class=" text-gold text-nowrap mr-10">账号</label>
                <input id="username" class="full-width game-input" type="text" name="username"
                       v-model.trim="form.username">
            </div>
            <div class="mb-10 d-flex align-items-center">
                <label style="width:80px;" for="password" class=" text-gold text-nowrap mr-10">密码</label>
                <input id="password" class="full-width game-input" type="password" name="password"
                       v-model.trim="form.password">
            </div>
            <div class="mb-10 d-flex align-items-center"v-if="form.action==='reg'">
                <label style="width:80px;" for="re_password" class=" text-gold text-nowrap mr-10">重复密码</label>
                <input id="re_password" class="full-width game-input"  type="password"
                       name="re_password"
                       v-model.trim="form.re_password">
            </div>
            <div class="text-center">
                <button class="brick-btn brick-btn-green" type="button" v-if="form.action==='reg'"
                        @click="onSubmit('reg')">
                    注册
                </button>
                <button class="brick-btn" type="button" @click="onSubmit('login')" v-else :disabled="!btnSubmitEnabled">登录</button>
            </div>
        </form>
    </div>
</div>
<script src="./../front/dist/account.js?t=<?= $ASSETS_TIME ?>"></script>
<?php include './../layout/foot.inc.php' ?>
